package com.alili.springbooteditor.dao;

import com.alili.springbooteditor.entities.Persons;
import com.alili.springbooteditor.repository.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PersonDao {
    @Autowired
    PersonRepository personRepository;
    @Cacheable(value = "person")
    public List<Persons> getUser(String username,String password){
        return personRepository.findPersonsByUsernameAndPassword(username,password);
    }
}
